<template>
  <div class="app-container"
       v-loading.fullscreen.lock="allLoading"
       element-loading-text="拼命处理中,请耐心等待"
       element-loading-spinner="el-icon-loading"
       element-loading-background="rgba(0, 0, 0, 0.8)"
  >
    <el-dialog :close-on-click-modal="false&&changeBitFlagIsNone" :title="mainDialogInfo.title" :visible.sync="showDialog"
               width="90%" append-to-body @close="closeDialog">
      <el-row :gutter="10" class="mb8 ml10">
        <div style="position: relative;float: left;align-items: center;display: flex;">
          <!--                例如-->
          <div class="ml5 mr5" style="font-size:18rpx;font-weight:bold;">
            向量化失败
          </div>
          <!--                          如果使用列表名称 按钮要放这里-->
          <el-col :span="1.5">
            <!--            <sks-button-->
            <!--              size="mini"-->
            <!--              type="primary"-->
            <!--              icon="el-icon-plus"-->
            <!--              @click="handleAdd()"-->
            <!--            >新增</sks-button>-->
          </el-col>
        </div>
        <!--        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
      </el-row>
      <el-table :data="form.errorList" stripe style="width: 100%">
        <el-table-column label="处理信息" align="center" prop="error_message" :show-overflow-tooltip="false">
          <template slot-scope="scope"> {{scope.row.error_message}} </template>
        </el-table-column>
        <el-table-column label="文件名" align="center" prop="file_name" />
        <el-table-column label="描述" align="center" prop="description" :show-overflow-tooltip="true" />
        <el-table-column label="文件大小" align="center" prop="file_size" :show-overflow-tooltip="true"  :formatter="formatterFileSize"/>
        <el-table-column label="状态" align="center" prop="status">
          <template slot-scope="scope">
            <dict-tag :options="dicts.knowledgeDocumentStatusOptions" :value="scope.row.status" />
          </template>
        </el-table-column>
        <el-table-column label="状态时间" align="center" prop="status_time" width="180">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.status_time) }}</span>
          </template>
        </el-table-column>
      </el-table>

      <el-row :gutter="10" class="mb8 ml10">
        <div style="position: relative;float: left;align-items: center;display: flex;">
          <!--                例如-->
          <div class="ml5 mr5" style="font-size:18rpx;font-weight:bold;">
            向量化成功
          </div>
          <!--                          如果使用列表名称 按钮要放这里-->
          <el-col :span="1.5">
<!--            <sks-button-->
<!--              size="mini"-->
<!--              type="primary"-->
<!--              icon="el-icon-plus"-->
<!--              @click="handleAdd()"-->
<!--            >新增</sks-button>-->
          </el-col>
        </div>
<!--        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
      </el-row>
      <el-table :data="form.successList" stripe style="width: 100%">
        <el-table-column label="处理信息" align="center" prop="error_message" :show-overflow-tooltip="false">
          <template slot-scope="scope"> {{scope.row.error_message}} </template>
        </el-table-column>
        <el-table-column label="文件名" align="center" prop="file_name" />
        <el-table-column label="描述" align="center" prop="description" :show-overflow-tooltip="true" />
        <el-table-column label="文件大小" align="center" prop="file_size" :show-overflow-tooltip="true"  :formatter="formatterFileSize"/>
        <el-table-column label="状态" align="center" prop="status">
          <template slot-scope="scope">
            <dict-tag :options="dicts.knowledgeDocumentStatusOptions" :value="scope.row.status" />
          </template>
        </el-table-column>
        <el-table-column label="状态时间" align="center" prop="status_time" width="180" :formatter="formatterTimeYmdHm"/>
      </el-table>

      <div slot="footer" class="dialog-footer">
        <!--        <template v-if="!changeBitFlagIsNone">-->
        <!--          <el-button type="primary" @click="submitMainDialog">确 定</el-button>-->
        <!--        </template>-->
        <el-button @click="cancelMainDialog">关 闭</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>

import { sksDialogFormMixin } from 'sks-plugin-el-erp/lib/dialog-form'
import request from '@/utils/request'
import { getFileNameWithoutExtension } from '@/utils/str'
import { formatFileSize } from 'sks-plugin-el-erp/lib/core'
import { delKnowledge } from '@/api/knowledge'
import { formatterTimeYmdHm } from '@/utils/el-utils'

export default {
  name: "MsgInfoByKnowledgeDocChangeStatusToDraftDialog",
  components: {  },
  mixins: [
    sksDialogFormMixin,
  ],
  data() {
    return {
      defaultForm: {
        id: undefined,
        //描述
        description: undefined,
        //备注
        remark: undefined,
      },
      defaultFormNotNull: {
        successList: [],
        errorList: [],
        //上传文件的列表,因为直接将待上传的file push进来无法刷新行信息
        virtualDocumentList: [],
      },
      extra:{
      },
    }
  },
  beforeCreate() {
    console.log('dicts',this.dicts)
  },
  methods:{
    formatterTimeYmdHm,
    closeDialogBefore(){
      console.log('----------closeDialogBefore')
      if(this.mainDialogInfo?.closeCallback){
        this.mainDialogInfo.closeCallback()
      }
    }
  }
}
</script>

